package com.h2View.service;

import com.h2View.db.dao.SqlMapper;
import com.h2View.utils.MybatisUtils;

import java.util.LinkedHashMap;
import java.util.List;

/**
 * @author 徐军文
 * @date 2021/7/8 21:42
 */
public class SqlService {


    public List<LinkedHashMap<String,Object>> showTables() {
        SqlMapper sqlMapper = MybatisUtils.getMapper(SqlMapper.class);
        List<LinkedHashMap<String,Object>> result = sqlMapper.customQueryItem("show tables");
        return result;
    }

    public List<LinkedHashMap<String,Object>> excuteSql(String sqlContent) {
        SqlMapper sqlMapper = MybatisUtils.getMapper(SqlMapper.class);
        List<LinkedHashMap<String,Object>> result = sqlMapper.customQueryItem(sqlContent);
        return result;
    }


}
